@keyframes cloud-left {
  to {
    transform: translateX(600px);
  }
}
@keyframes cloud-right {
  to {
    transform: translateX(-700px);
  }
}
.cloud {
  z-index: -1;
}
.cloud img {
  position: absolute;
}
.cloud img:nth-child(1) {
  top: 5px;
  right: 30px;
  animation: cloud-right 10s 0.4s infinite alternate linear;
}
.cloud img:nth-child(2) {
  top: 70px;
  left: 30px;
  animation: cloud-left 8s infinite alternate linear;
}
.cloud img:nth-child(3) {
  top: 300px;
  right: 30px;
  animation: cloud-right 7s infinite alternate linear;
}
.cloud img:nth-child(4) {
  top: 200px;
  left: 30px;
  animation: cloud-left 12s 0.5s infinite alternate linear;
}
.cloud img:nth-child(5) {
  top: 740px;
  right: 30px;
  animation: cloud-right 9s 0.2s infinite alternate linear;
}
.cloud img:nth-child(6) {
  top: 480px;
  left: 30px;
  animation: cloud-left 4s 0.5s infinite alternate linear;
}
.cloud img:nth-child(7) {
  bottom: 40px;
  right: 30px;
  animation: cloud-right 15s 0.3s infinite alternate linear;
}
* {
  text-decoration: none;
  list-style-type: none;
}
/* 隐藏滚动条 */
html {
  overflow: hidden;
  height: 100%;
}
body::-webkit-scrollbar {
  display: none;
}
/* Body 样式 */
body {
  background-color: skyblue;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 50px;
  box-sizing: border-box;
  overflow: auto;
  /* 恢复页面整体的滚动条 */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 水平居中内容 */
}
/* 地图容器样式 */
.mapContainer {
  border: 8px solid #575755;
  border-radius: 5px;
  overflow: auto;
  /* 允许滚动查看地图 */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* 从顶部开始对齐 */
  margin-top: 20px;
  /* 设置地图的顶部外边距 */
  display: none;
}
.mapContainer::-webkit-scrollbar {
  display: none;
}
.big-box {
  display: none;
}
.big-box .control-panel {
  border-radius: 25px;
  top: 100px;
  width: 130px;
  height: 600px;
  background-color: ghostwhite;
  border: 4px solid #575755;
  position: absolute;
  left: 10px;
}
.big-box .control-panel .top {
  text-align: center;
  margin-top: 10px;
  border-bottom: 4px solid #575755;
}
.big-box .control-panel .top div {
  margin-top: 5px;
}
.big-box .control-panel .top div:first-child {
  font-weight: 700;
  color: steelblue;
}
.big-box .control-panel .top div:first-child span {
  color: blue;
}
.big-box .control-panel .top div:nth-child(2) {
  font-weight: 900;
  color: goldenrod;
}
.big-box .control-panel .top button {
  margin: 0 auto;
  margin-top: 20px;
  width: 100px;
  height: 40px;
  border-radius: 5px;
  background-color: skyblue;
  font-style: inherit;
  font-weight: 1000;
  cursor: pointer;
}
.big-box .control-panel .bottom .build ul {
  text-align: center;
  padding: 0;
  margin: 0;
}
.big-box .control-panel .bottom .build ul li {
  margin: 0 auto;
  width: 80px;
  height: 120px;
  justify-content: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  border: 3px solid #575755;
  pointer-events: auto;
  cursor: pointer;
}
.big-box .control-panel .bottom .build ul li .unit-info {
  color: #575755;
  font-weight: 600;
}
.big-box .control-panel .bottom .build ul li .unit-image {
  width: 70px;
  height: 70px;
}
.big-box .control-panel .bottom .build ul li:first-child .unit-image {
  background-image: url(../res/chess/blue-soldier.png);
  background-size: cover;
}
.big-box .control-panel .bottom .build ul li:nth-child(2) .unit-image {
  background-image: url(../res/chess/blue-car.png);
  background-size: cover;
}
.big-box .control-panel .bottom .build ul li:last-child .unit-image {
  background-image: url(../res/chess/blue-tank.png);
  background-size: cover;
}
/* 地图样式 */
.map {
  display: grid;
  /* 使用 grid 布局 */
  grid-template-columns: repeat(auto-fill, 80px);
  /* 固定瓦片宽度 */
  position: relative;
}
/* 瓦片样式 */
.tile {
  width: 80px;
  /* 瓦片固定大小 */
  height: 80px;
  /* 瓦片固定大小 */
  position: relative;
  /* 保持 tile 的相对定位，以便让树定位在瓦片内 */
  transition: transform 0.2s, box-shadow 0.2s;
  /* 增加平滑效果 */
}
.tile:hover {
  box-sizing: border-box;
  border: 4px solid #e0d8bd;
}
/* 草地样式 */
.grass {
  background-color: #0da010;
}
/* 山样式 */
.mountain {
  background-color: #636262;
}
/* 湖泊样式 */
.lake {
  background-color: #1a68ef;
}
/* 树样式 */
.tree {
  position: absolute;
  /* 绝对定位以便在 grass 上垂直居中 */
  top: 50%;
  left: 50%;
  width: 40px;
  /* 树的大小设置为比草地瓦片小 */
  height: 40px;
  transform: translate(-50%, -50%);
  /* 使树在 grass 上垂直居中 */
  background-image: url("../res/tree.png");
  background-size: cover;
  pointer-events: none;
  /* 防止树层被点击 */
}
main {
  display: flex;
  /* 控制面板容器样式 */
}
main .container {
  width: 400px;
  height: 700px;
  background-color: burlywood;
  border-radius: 10px;
  border: 4px solid brown;
  text-align: center;
  position: relative;
  /* 使容器相对定位 */
  z-index: 10;
  /* 确保在地图之上 */
  margin-bottom: 20px;
  /* 增加与地图的间距，防止遮挡 */
}
main .container h1 {
  color: brown;
}
main .container label span {
  font-weight: 800;
  font-size: 20px;
}
main .container label .mapSizeSpan {
  color: chocolate;
}
main .container label .grassSpan {
  color: #246c24;
}
main .container label .mountainSpan {
  color: gray;
}
main .container label .lakeSpan {
  color: #1890ff;
}
main .container label .treeSpan {
  color: green;
}
main .container div {
  font-weight: 800;
  font-size: 20px;
}
main .container #mapSizeValue {
  color: chocolate;
}
main .container #grassRatioValue {
  color: #246c24;
}
main .container #mountainRatioValue {
  color: gray;
}
main .container #lakeRatioValue {
  color: #1890ff;
}
main .container #treeRatioValue {
  color: green;
}
main .container #generateMap {
  width: 150px;
  height: 50px;
  border-radius: 25px;
  background-color: yellowgreen;
  font-style: inherit;
  font-weight: 1000;
  font-size: 20px;
  cursor: pointer;
}
main .username {
  margin-left: 15px;
  background-color: burlywood;
  border-radius: 10px;
  border: 4px solid brown;
  width: 200px;
  height: 120px;
  text-align: center;
}
main .username input {
  vertical-align: middle;
  background-color: bisque;
  border: 2px solid brown;
}
main .username input:focus {
  outline: none;
  border-style: solid;
  box-shadow: 0 0 15px brown;
}
main .username span {
  font-size: large;
  font-weight: 700;
  margin-top: 30px;
}
main .username .blue {
  color: blue;
}
main .username .red {
  color: red;
}
input[type="range"] {
  appearance: none;
  width: 300px;
  border-radius: 10px;
  /* 这个属性设置使填充进度条时的图形为圆角 */
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 25px;
  width: 25px;
  background: #b59b7e;
  border-radius: 50%;
  /* 外观设置为圆形 */
}
input[type="range"]::-webkit-slider-runnable-track {
  background-color: #e0d8bd;
  border-radius: 10px;
  /* 将轨道设为圆角的 */
}
/* 棋子样式 */
.chess {
  position: absolute;
  /* 绝对定位以便在瓦片内居中 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* 使棋子在瓦片内垂直居中 */
  width: 50px;
  /* 根据需要设置棋子的大小 */
  height: 50px;
  pointer-events: auto;
  /* 允许棋子被点击 */
  cursor: pointer;
  /* 鼠标悬浮在棋子上时变为指针，表明可交互 */
}
.tank {
  width: 50px;
  height: 50px;
  background-size: cover;
}
.soldier {
  width: 50px;
  height: 50px;
  background-size: cover;
}
.car {
  width: 50px;
  height: 50px;
  background-size: cover;
}
.Blue-tank {
  background-image: url(../res/chess/blue-tank.png);
}
.Blue-soldier {
  background-image: url(../res/chess/blue-soldier.png);
}
.Blue-car {
  background-image: url(../res/chess/blue-car.png);
}
.Blue-home {
  background-image: url(../res/chess/blue-home.png);
}
.Red-tank {
  background-image: url(../res/chess/red-tank.png);
}
.Red-soldier {
  background-image: url(../res/chess/red-soldier.png);
}
.Red-car {
  background-image: url(../res/chess/red-car.png);
}
.Red-home {
  background-image: url(../res/chess/red-home.png);
}
.home {
  position: absolute;
  /* 绝对定位以便在瓦片内居中 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* 使棋子在瓦片内垂直居中 */
  width: 50px;
  /* 根据需要设置棋子的大小 */
  height: 50px;
  pointer-events: auto;
  /* 允许棋子被点击 */
  cursor: pointer;
  /* 鼠标悬浮在棋子上时变为指针，表明可交互 */
  background-size: cover;
}
.highlight-home-area {
  border-color: azure;
}
#map {
  max-width: 800px;
  max-height: 800px;
  overflow-x: scroll;
  scroll-behavior: smooth;
}
#map::-webkit-scrollbar {
  border-radius: 10%;
}
#map::-webkit-scrollbar-track {
  background-color: burlywood;
}
#map::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 10px;
  background-color: brown;
}
#map::-webkit-scrollbar-corner {
  background-color: burlywood;
}
.player-information {
  position: absolute;
  right: 15px;
  top: 100px;
  width: 300px;
  height: 700px;
  background-color: burlywood;
  border-radius: 10px;
  border: 4px solid brown;
  text-align: center;
}
.player-information h1 {
  color: brown;
}
.player-information table {
  margin: 0 auto;
}
.player-information table tr {
  background-color: beige;
}
@media (max-width: 1480px) {
  .map {
    width: 600px;
    height: 600px;
  }
}
